package com.grm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.grm.common.Result;
import com.grm.enums.CodeMessageEnum;
import com.grm.service.UserService;

/**
 * desc: 并发处理list的案例
 *
 * @author gaorimao
 * @since 2021-3-15
 */
@RestController
@RequestMapping("/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@GetMapping("/send")
	public Result sendMessageToUsers() {
		userService.sendMessagetoUsers();
		return Result.success(CodeMessageEnum.SUCCESS.getMessage());
	}
	
	@GetMapping("/query/datas")
	public Result queryDatas() {
		List<String> datas = userService.queryDatas();
		return Result.success(CodeMessageEnum.SUCCESS.getMessage(),datas);
	}

}
